Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export glm as interface library for CMake 2.8.12 and newer #324

Merged
merged 4 commits into from
May 1, 2015

Conversation

shaxbee
Copy link

@shaxbee shaxbee commented Mar 29, 2015

Using INTERFACE library type defines header-only library and exports it using CMake packaging system. Version file is also created and policy of version matching is currently set to AnyNewerVersion.
This gives build equivalency for external_project_add / system-wide installation, and removes the need to call include_directories in clients CMakeLists.txt.

For details see:

Usage:

find_package(glm 0.9.6 REQUIRED)
add_executable(foo foo.cpp)
target_link_libraries(foo glm) # this will add glm include directory to the target

For backwards compatibility glmConfig.cmake sets "GLM_INCLUDE_DIRS".

@shaxbee
Copy link
Author

shaxbee commented Mar 29, 2015

@ngvitovitch done the CMake packaging - care to take a look?

@shaxbee shaxbee force-pushed the master branch 2 times, most recently from d7a674b to 5a66bd3 Compare March 29, 2015 17:33
@Groovounet Groovounet added this to the GLM 0.9.7 milestone May 1, 2015
@Groovounet Groovounet self-assigned this May 1, 2015
Groovounet added a commit that referenced this pull request May 1, 2015
Export glm as interface library for CMake 2.8.12 and newer #324
@Groovounet Groovounet merged commit 476ea7b into g-truc:master May 1, 2015
@shaxbee
Copy link
Author

shaxbee commented May 2, 2015

@Groovounet I've added one more commit to my fork which improves compatibility for build tree export for older cmake versions and bumps version number to 0.9.7 - could you cherry-pick it into master or should I open new pull request?

@Groovounet
Copy link
Member

A pull request would be nice as I had to tweak this improvement to get it to work on old version of CMake. Hence, I expect some conflics

Thanks,
Christophe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants